//生成token

const uuidv4 = require('uuid/v4');

module.exports = function () {
    var uid = uuidv4();
    return new Buffer(uid).toString('base64');
}


/*
 *
 * var b = new Buffer('JavaScript');
 var s = b.toString('base64');
 // SmF2YVNjcmlwdA==


 var b = new Buffer('SmF2YVNjcmlwdA==', 'base64')
 var s = b.toString();
 // JavaScript
 * */